package cn.oop.inherit;

/*
 * 测试组合
 */
public class Animal2 {
    String eye;
    String foot;

    public void Run() {
        System.out.println("跑!");
    }

    public void Eat() {
        System.out.println("吃！");
    }

    public void sleep() {
        System.out.println("zzzzz");
    }

    public Animal2() {
        super();
        System.out.println("建一只鸟");
    }

    public static void main(String[] args) {
        bird2 aaa = new bird2();
        aaa.Run();
    }
}

class Mammal2 {
    Animal2 animal2;

    public void taisheng() {

        System.out.println("胎生");
    }
}

class bird2 {
    Animal2 animal2 = new Animal2();

    public void Run() {
        animal2.Run();
        System.out.println("我是一只小小鸟,想要飞却怎么样也非不高");
    }

    public void eggsheng() {
        System.out.println("卵生!");
    }
} 

